<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>日志管理</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	
	-->
	<link rel="stylesheet" type="text/css" href="Ext/resources/css/ext-all.css" />
	
	<script type="text/javascript" src="Ext/adapter/ext/ext-base.js"></script>
	<script type="text/javascript" src="Ext/ext-all.js"></script>
	<script type="text/javascript">
	Ext.onReady(function() { 
         var ds=new Ext.data.Store({
              proxy: new Ext.data.HttpProxy({url:'index.jsp'}),
              reader: new Ext.data.XmlReader({
              record: 'record',
              id: 'log_id',
              totalRecords: 'totalProperty'
              },[
                 {name: 'id', mapping: 'log_id'},
                  {name: 'fac', mapping: 'fac_id'},
                  {name: 'oprt', mapping: 'oprt'},
                  {name: 'user', mapping: 'user_id'},
                  {name: 'date', mapping: 'oprt_date'}
              ]
              )
         });
         
       
        var grid = new Ext.grid.GridPanel({
        title:"日志记录",
        store: ds,
        columns: [
            {header: "编号", width: 120, dataIndex: 'id', sortable: true},
            {header: "操作", width: 100, dataIndex: 'fac', sortable: true},
            {header: "操作描述", width: 115, dataIndex: 'oprt', sortable: true},
            {header: "用户编号", width: 100, dataIndex: 'user', sortable: true},
            {header: "操作日期", width: 200, dataIndex: 'date', sortable: true}
        ],
        tbar: new Ext.PagingToolbar({
            pageSize: 5,
            store: ds,
            displayInfo: true,
            displayMsg: '显示第 {0} 条到 {1} 条记录，一共 {2} 条',
            emptyMsg: "没有记录"
        }),
        bbar: new Ext.PagingToolbar({
            pageSize: 5,
            store: ds,
            displayInfo: true,
            displayMsg: '显示第 {0} 条到 {1} 条记录，一共 {2} 条',
            emptyMsg: "没有记录"
        }),
        renderTo:'example-grid',
        autoWidth: true,
        autoHeight: true
    });
       // ds.load({params:{start:0,limit:5}});
        
        
     var simple = new Ext.FormPanel({
        labelWidth: 75, // label settings here cascade unless overridden
        url:'',
        frame:true,
        title: '日志记录查询',
        bodyStyle:'padding:5px 5px 0',
        width: 350,
        defaults: {width: 230},
        defaultType: 'textfield',
        renderTo:'query-panel',
        items: [{
                fieldLabel: '用户编号',
                name: 'first',
                id:'first',
                //llowBlank:false
            },{
                fieldLabel: 'Last Name',
                name: 'last'
            },{
                fieldLabel: 'Company',
                name: 'company'
            }, {
                fieldLabel: 'Email',
                name: 'email',
                vtype:'email'
            }, new Ext.form.TimeField({
                fieldLabel: 'Time',
                name: 'time',
                minValue: '8:00am',
                maxValue: '6:00pm'
            })
        ],

        buttons: [{
            text: '查询',
            handler:function(){
            var k = Ext.getCmp("first").getValue();
            ds.baseParams={keyword:k};
            ds.reload({params:{start:0,limit:5}});
            
                 }
        }
        ]
    });

   
       
}); 

	</script>



  </head>
  
  <body>
  <div id="query-panel" style="width:700px; margin-top:10px; margin-left:200px"></div>
<div id="example-grid" style="width:700px; margin-top:5px; margin-left:200px"></div>
  </body>
</html>
